<%--
  Created by IntelliJ IDEA.
  User: jshand
  Date: 2022-10-21
  Time: 11:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    String username = request.getParameter("username");
    String password = request.getParameter("password");

    if("admin".equals(username) && "123456".equals(password)){
        session.setAttribute("isLogin",true);
        session.setAttribute("username",username);
        response.sendRedirect(request.getContextPath()+"/index.jsp");
        return;
    }
%>




<form action="login.jsp">
    用户名: <input type="text" name="username" value="" > <br>
    密码: <input type="password" name="password" value="" > <br>

    <input type="submit"/>
</form>




</body>
</html>
